<?php

 require_once("../include/httpclient.php");
 require_once("../include/db_mysql.php");
// serviceurl：103 站内搜索，假定用户输入的信息含义是 partyName ,message，首先查询partyname 返回partyId的列表，LM为landmarkId
function SiteSearch($arg)
{
//返回第几页的数据，一页20户商家
 $page = $arg['page'];
 $data = array('input' =>urlencode(stripslashes($arg['input'])),'LM'=>urlencode(stripslashes($arg['LM'])));
 //查询Party系统，partyName和message，优先查询partyName，查找到的商家不到max值，则继续查message
 $partyIdArrayJson = call_serviceurl(104,$data);
 $partyIdArray = json_decode($partyIdArrayJson,true);
 $totalPageNum = ceil(count($partyIdArray)/20);
 $resultByPage = array_splice($partyIdArray,($page-1)*20,20);
 $return = array($resultByPage,$totalPageNum);  
 return json_encode($return);
}
?>